﻿<div class="orders view">
    <div class="container">
        <header>
            <h3><span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;All Customer Orders</h3>
        </header>
        <br />
        <div class="customerEdit">
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="navbarText col-sm-2">Filter by Name/Product:</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control novalidate"
                               data-ng-model="vm.searchText"
                               data-ng-change="vm.searchTextChanged()" />
                    </div>
                </div>
            </form>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-md-12 repeat-animation" data-ng-repeat="customer in vm.filteredCustomers | orderBy:'lastName'">
                    <div>
                        <h4><a href="#/customerorders/{{customer.id}}">{{ customer.firstName + ' ' + customer.lastName }}</a></h4>
                    </div>
                    <div data-ng-include="'/app/customersApp/views/orders/ordersTable.html'" data-ng-controller="OrderChildController as vm" />
                </div>
            </div>
            <div class="row show-hide-animation" data-ng-show="vm.filteredCustomers.length == 0">
                <div class="col-md-12">
                    <h4>No customers found</h4>
                </div>
            </div>
            <div class="row show-hide-animation" data-ng-show="vm.customers.length > 0" style="margin-left:0px;">
                <div class="col-md-12">
                    <div data-pagination
                         data-on-select-page="vm.pageChanged(page)"
                         data-total-items="vm.totalRecords"
                         data-page="vm.currentPage"
                         data-boundary-links="true"
                         class="pagination-sm">
                    </div>
                    <h5>Showing {{ vm.filteredCount }} of {{ vm.totalRecords}} total customers</h5>
                </div>
            </div>
        </div>
    </div>
    <br /><br /><br />
</div>

